package com.shxy.dao.news;

import com.shxy.entity.news.NewsInCatagory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface NewsInCatagoryDao extends JpaRepository<NewsInCatagory, String> {
    /**
     * 根据栏目和新闻编号查询
     * @param newsId
     * @param catagoryId
     * @return
     */
    NewsInCatagory findByCatagoryIdAndNewsId(String newsId, String catagoryId);

    /**
     * 分页查询栏目新闻列表
     * @param catagoryId
     * @param page
     * @return
     */
    Page<NewsInCatagory> findAllByCatagoryId(String catagoryId, Pageable page);
}
